package com.scott.crm.resume.utils;

import com.scott.base.message.DataRes;
import com.scott.base.message.DataUtil;
import com.scott.base.utils.AESUtil;
import jdk.nashorn.internal.parser.Token;

public class QuestionUtils {

    /**
     * 方法描述: 将令牌字符串解密，并转换成Integer对象返回,解密失败返回-1
     * @author: 黄德标
     * @date: 2021/11/30 9:06
     * @param: [java.lang.String]
     * @return: java.lang.Integer
     */
    public static Integer DecryptUserId(String token){
        Integer rs;
        try {
            String stringUserId = AESUtil.decrypt(token, AESUtil.KEY);
            rs = Integer.parseInt(stringUserId);
        } catch (Exception e) {
            System.out.println(e);
            rs = -1;
        }
        return rs;
    }


}
